package br.com.fogas.webservice.parser.visita;

public class VisitaRequestBuilder {

	private VisitaEnvelope envelope;
	
	private VisitaRequest visitaRequest;
	
	private VisitaBody visitaBody;
	
	private VisitaRequestItem request;
	
	private String mandt;
	
	private String plano;
	
	private String nfNum;
	
	private String nfSerie;
	
	private String cliente;
	
	private String obs1;
	
	private String obs2;
	
	private String url1;
	
	private String url2;
	
	private String gravado;
	
	public VisitaRequestBuilder() {
		this.visitaRequest = new VisitaRequest();
		this.visitaBody = new VisitaBody();
		this.request = new VisitaRequestItem();
		
		this.visitaRequest.setBody(visitaBody);
		this.visitaBody.setItem(request);
	}
	
	public VisitaEnvelope envelope(VisitaRequestItem request) {
		this.visitaRequest.getBody().setItem(request);
		this.envelope = new VisitaEnvelope();
		this.envelope.body.request = visitaRequest;
		return envelope;
	}
	
	public VisitaRequestItem request() {
		this.request.setMANDT(mandt);
		this.request.setPLANO(plano);
		this.request.setNFENUM(nfNum);
		this.request.setSERIES(nfSerie);
		this.request.setKUNNR(cliente);
		this.request.setOBS1(obs1);
		this.request.setOBS2(obs2);
		this.request.setURL1(url1);
		this.request.setURL2(url2);
		this.request.setGRAVADO(gravado);
		return request;
	}

	public VisitaRequestBuilder mandt(String mandt) {
		this.mandt = mandt;
		return this;
	}

	public VisitaRequestBuilder plano(String plano) {
		this.plano = plano;
		return this;
	}

	public VisitaRequestBuilder nfNum(String nfNum) {
		this.nfNum = nfNum;
		return this;
	}

	public VisitaRequestBuilder nfSerie(String nfSerie) {
		this.nfSerie = nfSerie;
		return this;
	}

	public VisitaRequestBuilder cliente(String cliente) {
		this.cliente = cliente;
		return this;
	}

	public VisitaRequestBuilder obs1(String obs1) {
		this.obs1 = obs1;
		return this;
	}

	public VisitaRequestBuilder obs2(String obs2) {
		this.obs2 = obs2;
		return this;
	}

	public VisitaRequestBuilder url1(String url1) {
		this.url1 = url1;
		return this;
	}

	public VisitaRequestBuilder url2(String url2) {
		this.url2 = url2;
		return this;
	}

	public VisitaRequestBuilder gravado(String gravado) {
		this.gravado = gravado;
		return this;
	}
}